import React from 'react'
import BaseFilter, {filterCodes} from "../Base/BaseFilter";
import BaseFormItem from "../Base/BaseFormItem";
import {isArray, isEmpty, map} from "lodash-es";
import NumberBase from "./NumberBase";
import {Input} from 'antd';
import RangeBase from "./RangeBase";

class NumberFilterBase extends BaseFilter {

    comboData = [
        filterCodes.eq, filterCodes.noEq,
        filterCodes.gt, filterCodes.gtEq,
        filterCodes.lt, filterCodes.ltEq,
        filterCodes.between
    ];

    compRender(moreProps = {}) {

        if (filterCodes.between.code === this.state.comboVal) { // 介于

            return (
                <RangeBase {...moreProps} />
            );

        } else {
            return (<NumberBase {...moreProps}/>);
        }

    }

}

export default class NumberFilter extends BaseFormItem {
    Comp = NumberFilterBase;
}